<template>
    <a-modal
        title="反馈意见"
        :visible="visible"
        :width="800"
        :confirmLoading="loading"
        @ok="() => $emit('ok', this.queryParam)"
        @cancel="() => $emit('cancel')"
    >
        <a-spin :spinning="loading">
            <a-form-model ref="form" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol" :rules="rules">
                <a-form-model-item label="反馈意见" prop="feedbackContent">
                    <BaseTextarea label="反馈意见" v-model="queryParam.feedbackContent" />
                </a-form-model-item>
            </a-form-model>
        </a-spin>
    </a-modal>
</template>

<script>
export default {
    name: 'addFeedback',
    props: {
        visible: {
            type: Boolean,
            default: () => false
        },
        loading: {
            type: Boolean,
            default: () => false
        }
    },
    watch: {
        visible(e) {
            if (!e) {
                this.queryParam = { feedbackContent: '' }
                this.$refs.form.clearValidate()
            }
        }
    },
    data() {
        return {
            queryParam: {
                feedbackContent: ''
            },
            labelCol: { span: 3 },
            wrapperCol: { span: 21 },
            rules: {
                feedbackContent: [{ required: true, message: '请输入反馈内容', trigger: 'blur' }]
            }
        }
    }
}
</script>

<style scoped>
</style>
